<template>
	<view class="beInHospital">
		<view class="example">
			<u--form ref="uForm" :model="user" labelWidth="80px">
				<u-form-item label="姓名" prop="xm" required>
					<u-input v-model="user.xm" placeholder="请输入姓名" />
				</u-form-item>
				<u-form-item label="住院号" prop="bah" required>
					<u-input v-model="user.bah" placeholder="请输入住院号" />
				</u-form-item>
			</u--form>
		</view>
		<view class="footer">
			<u-button type="primary" style="width:90%;" @click="checkPersonInfo">入院登记查询</u-button>
		</view>
	</view>
</template>

<script>
	import { getSearchHzxx } from "@/api/beInHospital/index.js"
	export default {
		components: {
		},
		data() {
			return {
				user:{
					xm:'',
					bah:''
				},
			}
		},
		onLoad(options) {
			
		},
		methods: {
			/* 查询当前就诊人入院信息 */
			checkPersonInfo() {
				if (this.user.xm == '') {
					this.$msg("请输入姓名")
					return
				}else if (this.user.bah == '') {
					this.$msg("请输入住院号")
					return
				}
				getSearchHzxx(this.user).then(res => {
					if (res.code == 200) {
						uni.navigateTo({
							url: '/pages/home/recharge?xm='+this.user.xm+'&bah='+this.user.bah
						})
					}
				}).catch(error => {});
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: rgb(245, 245, 245);
	}
	
	.footer {
		background-color: #fff;
		position: fixed;
		width: 100%;
		bottom: 0;
		left: 0;
		padding: 30rpx 0;
	}

	.u-form-item {
		margin: 10px 0;
		padding: 3px 15px;
		background: #fff;
		border-bottom: 1px solid rgb(245, 245, 245);
	}
</style>